package com.shenmazong.user.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 军哥
 * @version 1.0
 * @description: 静态资源文件映射
 * @date 2022/7/1 16:21
 */

@Slf4j
@Configuration
public class WebMvcConfiguration implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        String location = "file:///E:/test/upload/";
        log.info("localtion:"+location);

        registry.addResourceHandler("/images/**")
                .addResourceLocations(location);
    }
}
